Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

submit questions on paste #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

whsu00
Copy link

@whsu00 whsu00 commented Sep 23, 2020

No description provided.

@@ -158,6 +166,7 @@ export default function Question({
onChange={(e) => {
setValue(e.target.value);
}}
onPaste={submit}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not work, because the value state would not have updated in the submit closure. You want to write a handlePaste that calls submitValue with the pasted value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh how I've missed the javascript event loop..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants